package com.example.sixtrainingdemo.view;

import android.content.Intent;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.RelativeLayout;

import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;

import com.example.sixtrainingdemo.R;
import com.example.sixtrainingdemo.adapter.GoodsListAdapter;
import com.example.sixtrainingdemo.base.BaseFragment;
import com.example.sixtrainingdemo.contract.MainContract;
import com.example.sixtrainingdemo.entity.Goods;
import com.example.sixtrainingdemo.presenter.MainPresenter;

import java.util.ArrayList;
import java.util.List;

public class MessageFragment extends BaseFragment implements MainContract.IMainView, View.OnClickListener {



   // 为每个 RelativeLayout 创建独立的引用
   private RelativeLayout mSettingView01;
   private RelativeLayout mSettingView02;
   private RelativeLayout mSettingView03;
   private RelativeLayout mSettingView04;

   @Override
   protected int getLayoutId() {
      return R.layout.fragment_message;
   }

   @Override
   protected void initView() {
      // 为每个 RelativeLayout 获取引用
      mSettingView01 = mView.findViewById(R.id.settingView_01);
      mSettingView02 = mView.findViewById(R.id.settingView_02);
      mSettingView03 = mView.findViewById(R.id.settingView_03);
      mSettingView04 = mView.findViewById(R.id.settingView_04);
   }
//
   @Override
   protected void initListener() {
      mSettingView01.setOnClickListener(this);
      mSettingView02.setOnClickListener(this);
      mSettingView03.setOnClickListener(this);
      mSettingView04.setOnClickListener(this);
   }
//
   @Override
   public void showGoodsList(List<Goods> goodsList) {
   }

   @Override
   public void onClick(View v) {
      int id = v.getId();
      if (id == R.id.settingView_03) {
         Intent intent = new Intent(mContext, TalkActivity.class);
         startActivity(intent);
      }else if (id == R.id.settingView_01) {
         Intent intent = new Intent(mContext, TalkActivity.class);
         startActivity(intent);
      }else if (id == R.id.settingView_02) {
         Intent intent = new Intent(mContext, TalkActivity.class);
         startActivity(intent);
      }else if (id == R.id.settingView_04) {
         Intent intent = new Intent(mContext, TalkActivity.class);
         startActivity(intent);
      }

}
}